/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ejb;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author timoteus78
 */
@Entity
@Table(name = "Movie")
@NamedQueries({@NamedQuery(name = "Movie.findByMID", query = "SELECT m FROM Movie m WHERE m.mID = :mID"), @NamedQuery(name = "Movie.findByMName", query = "SELECT m FROM Movie m WHERE m.mName = :mName"), @NamedQuery(name = "Movie.findByMDirector", query = "SELECT m FROM Movie m WHERE m.mDirector = :mDirector"), @NamedQuery(name = "Movie.findByMRating", query = "SELECT m FROM Movie m WHERE m.mRating = :mRating"), @NamedQuery(name = "Movie.findByMYear", query = "SELECT m FROM Movie m WHERE m.mYear = :mYear"), @NamedQuery(name = "Movie.findByMDistributor", query = "SELECT m FROM Movie m WHERE m.mDistributor = :mDistributor"), @NamedQuery(name = "Movie.findByMGenre", query = "SELECT m FROM Movie m WHERE m.mGenre = :mGenre")})
public class Movie implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "mID", nullable = false)
    private Short mID;
    @Column(name = "mName", nullable = false)
    private String mName;
    @Column(name = "mDirector")
    private String mDirector;
    @Column(name = "mRating")
    private Integer mRating;
    @Column(name = "mYear")
    private Integer mYear;
    @Column(name = "mDistributor")
    private String mDistributor;
    @Column(name = "mGenre")
    private String mGenre;

    public Movie() {
    }

    public Movie(Short mID) {
        this.mID = mID;
    }

    public Movie(Short mID, String mName) {
        this.mID = mID;
        this.mName = mName;
    }

    public Short getMID() {
        return mID;
    }

    public void setMID(Short mID) {
        this.mID = mID;
    }

    public String getMName() {
        return mName;
    }

    public void setMName(String mName) {
        this.mName = mName;
    }

    public String getMDirector() {
        return mDirector;
    }

    public void setMDirector(String mDirector) {
        this.mDirector = mDirector;
    }

    public Integer getMRating() {
        return mRating;
    }

    public void setMRating(Integer mRating) {
        this.mRating = mRating;
    }

    public Integer getMYear() {
        return mYear;
    }

    public void setMYear(Integer mYear) {
        this.mYear = mYear;
    }

    public String getMDistributor() {
        return mDistributor;
    }

    public void setMDistributor(String mDistributor) {
        this.mDistributor = mDistributor;
    }

    public String getMGenre() {
        return mGenre;
    }

    public void setMGenre(String mGenre) {
        this.mGenre = mGenre;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (mID != null ? mID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Movie)) {
            return false;
        }
        Movie other = (Movie) object;
        if ((this.mID == null && other.mID != null) || (this.mID != null && !this.mID.equals(other.mID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ejb.Movie[mID=" + mID + "]";
    }

}
